package thread;

import java.util.concurrent.atomic.AtomicInteger;

public class Demo38 {
    public static void main(String[] args) {
        AtomicInteger count = new AtomicInteger(0);
        System.out.println(count.get()); // 0
        System.out.println(count.incrementAndGet()); // ++count
        System.out.println(count.get()); // 1
        System.out.println(count.getAndIncrement()); // 1
        System.out.println(count.addAndGet(10)); // ++10
        System.out.println(count.getAndAdd(20));
    }
}
